//CS 321 Implementation

/*
 * Temp Control Class
 * 
 * 
 * 
 * 
 * 
 */

public class TempControl
{
 //Responsible for setting and getting temperature and mode
  
  //desiredTemp, is the temperature the user wants
  float desiredTemp;
  
  //currentTemp, is the current temperature
  float currentTemp;
  
  //myTemp will hold all temperature data
  
  Temperature myTemp;
  Thermostat myTherm;
  //constructor creates the defaults temperatures
  public TempControl(float current, float desired)
  {
   this.currentTemp=current;
   this.desiredTemp=desired;
   myTemp=new Temperature(currentTemp); 
   myTherm=new Thermostat(currentTemp,desiredTemp);
  }
  
  //set mode will allow the user to select a temperature and change the
  //current temp of the thermostat
  //return a String that shows the changed temp
  public String setMode(float desiredTemp)
  {
   
    this.desiredTemp=myTherm.setDesiredTemp(myTemp,desiredTemp);
     
    
    String changes="The Current Temperature is: "+ this.currentTemp + " and has now been changed to: " + this.desiredTemp;
    this.currentTemp=desiredTemp;
    
    return changes;
  }
  
  //monitor temp returns whether the current temp is = to the desiredtemp
  
  public boolean monitorTemp()
  {

    return myTemp.getTemp()==this.currentTemp;
  }
  

  
}